const BASE_URL = 'https://www.uinav.com'
class WRequest {
	request(url, method, data) {
		return new Promise((resolve, reject) => {
			return uni.request({
				url: BASE_URL + url, //仅为示例，并非真实接口地址。
				data,
				method,
				success: (res) => {
					resolve(res.data)
				},
				fail(reason) {
					reject(reason)
				}
			});
		})
	}
	
	get(url,params) {
		return this.request(url,'GET',params)
	}
	
	post(url,data) {
		return this.request(url,'POST',data)
	}
}

const wRequest = new WRequest()

export default wRequest